home *** CD-ROM | disk | FTP | other *** search
- p @"This demo is designed to show how sdb may be used to debug"
- p @"desk accessories and drivers. If you aren't already familiar"
- p @"with the basic use of sdb, you should first run the count demo."
- p @"To invoke it from the finder, just double click on the"
- p @"count.dbg icon."
- p @" "
- p @"You can terminate this session by entering a Ctrl-C or Cmd-C"
- p @"to gain control of sdb, and than a q at the sdb prompt."
- p @" "
- &
- p @"This demo requires the Explorer desk accessory to be installed"
- p @"in the currently active system file. If you booted from"
- p @"the demo disk, it's already been done for you. If not, you"
- p @"need to terminate this session and use the Font D/A Mover to"
- p @"install explor."
- p @" "
- &
- p @"At this point sdb has been invoked with no program loaded."
- p @"This is important, since the alternate .dbg file for the"
- p @"desk accessory must be loaded before a program is launched."
- p @"Let's do that now with the ala command. We'll be working"
- p @"with the DA called explor which is one of the example programs"
- p @"included on your Aztec C disks."
- p @" "
- &
- oe
- ala explor
- oe
- p @" "
- p @"The .dbg file for the desk accessory has been loaded."
- p @"It's now necessary to load a primary application from"
- p @"which the desk accessory may be exercised. In this case"
- p @"we'll use datest, a skeleton application to put up the"
- p @"Apple menu to access desk accessories along with a File"
- p @"menu with a Quit command. To load it we use the lp command."
- p @" "
- &
- oe
- lp datest
- oe
- p @"The datest application has been loaded and we're viewing it's"
- p @"source. It now remains for us to load the actual desk accessory."
- p @"This resource must be in the system file in order to be loaded"
- p @"and debugged. The command ald followed by the resource type and"
- p @"name or id number is used to load the desk accessory into memory."
- p @" "
- &
- oe
- ald DRVR Explorer
- oe
- p @" "
- p @"As you can see, the ald command is generic enough to handle other"
- p @"things such as drivers and even other resource types such as FKEYs."
- p @"We now have the desk accessory loaded, but are still viewing datest,"
- p @"the primary application. To switch the context of sdb to view and"
- p @"debug the desk accessory, we'll need to use the ax command."
- p @" "
- &
- oe
- ax
- oe
- p @" "
- p @"Now that the labels have been changed to those of the desk accessory,"
- p @"we'll view and set breakpoints in explor. Let's look at the routine"
- p @"open() which is called early on when the desk accessory is selected."
- p @" "
- &
- oe
- df open
- oe
- p @"As you can see, we're now viewing the source for explor. But although"
- p @"we're viewing the source for explor, the PC indicates that we're still"
- p @"in datest. To remedy that we'll set a breakpoint on open and let"
- p @"datest run. That way sdb will regain control when the desk accessory"
- p @"is selected."
- p @" "
- &
- oe
- bs open
- oe
- p @"Now we're all set to enter the desk accessory. The only thing that"
- p @"remains is for us to enter a g to go. Having done that, the application"
- p @"datest will be running and you'll be in control. To reenter sdb"
- p @"you will need to open the desk accessory explor by selecting it from"
- p @"the apple menu. At that point sdb under the control of this command"
- p @"file will take over again."
- p@" "
- &
- oe
- g
- oe
- p @"OK, you've succesfully entered the desk accessory and can see by the"
- p @"highlighted line in the source file that we're ready to execute the"
- p @"open function. Now that you're in the desk accessory, the use of sdb"
- p @"to step through and debug it is virtually identical to debugging a"
- p @"primary application. In most cases when debugging a desk accessory, you"
- p @"won't need to worry about the primary application that has invoked it."
- p @"But if for some reason you should need to return to it, sdb still has"
- p @"the necessay .dbg information to do that. To do it, you'd execute"
- p @"the ax command a second time and set the necessary breakpoints."
- p@" "
- &
- p @"Since the purpose of this demo was to show you how to load and enter"
- p @"a desk accessory we'll stop here and let you take over."
- p @n"The command file has now terminated, and you're in control."
-